using Holoville.HOTween;
using UnityEngine;

public class AnimBut : MonoBehaviour
{
	public GameObject objImage;

	private Vector3 scaleStart;

	private void Awake()
	{
		HOTween.Init();
		if (objImage != null)
		{
			scaleStart = objImage.transform.localScale;
		}
	}

	private void OnPress(bool isPressed)
	{
		if (objImage != null)
		{
			if (isPressed)
			{
				HOTween.Kill(objImage.transform);
				HOTween.To(objImage.transform, 0.2f, new TweenParms().Prop("localScale", new Vector3(0.5f, 0.5f, 0.5f)));
			}
			else
			{
				HOTween.Kill(objImage.transform);
				HOTween.To(objImage.transform, 0.2f, new TweenParms().Prop("localScale", scaleStart));
			}
		}
	}
}
